package io.jt808.proto.item;


import io.norland.buffer.AutoBuffer;
import io.norland.proto.IProto;

public class PositionAdditional03RecorderSpeed implements IProto {
    private int recorderSpeed;

    public byte[] writeToBytes() {
        AutoBuffer buffer = new AutoBuffer();
        buffer.writeShort(this.recorderSpeed);
        return buffer.array();
    }

    public void readFromBuf(AutoBuffer buffer) {
        this.recorderSpeed = buffer.readShort();
    }

    public int getRecorderSpeed() {
        return this.recorderSpeed;
    }

    public void setRecorderSpeed(int recorderSpeed) {
        this.recorderSpeed = recorderSpeed;
    }

    public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof PositionAdditional03RecorderSpeed)) return false;
        PositionAdditional03RecorderSpeed other = (PositionAdditional03RecorderSpeed) o;
        if (!other.canEqual(this)) return false;
        return getRecorderSpeed() == other.getRecorderSpeed();
    }

    protected boolean canEqual(Object other) {
        return other instanceof PositionAdditional03RecorderSpeed;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        return result * 59 + getRecorderSpeed();
    }

    public String toString() {
        return "PositionAdditional03RecorderSpeed(recorderSpeed=" + getRecorderSpeed() + ")";
    }
}